﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebWise.Models;

namespace WebWise.Controllers
{
    public static class SuperController
    {
        static List<Link> AddedLinks;

        public static LayoutModel GetGlobalModel(){

            LayoutModel GlobalModel = new LayoutModel();

            List<Link> links = new List<Link>(3);
            links.Add(new Link("GTRI Home", "http://webwise.gtri.gatech.edu"));
            links.Add(new Link("Google", "http://google.com"));
            links.Add(new Link("Georgia Tech", "http://gatech.edu"));
            links.Add(new Link("T-Square", "http://tsquare.gatech.edu"));

            GlobalModel.MyLinks = links;

            if (AddedLinks != null){
                GlobalModel.MyLinks.AddRange(AddedLinks);
            }

            return GlobalModel;

        }

        public static void AddLink(string Name, string Url)
        {
            if (AddedLinks == null)
            {
                AddedLinks = new List<Link>();
            }

            AddedLinks.Add(new Link(Name, Url));
        }

    }
}
